/**
 * 项目名称:
 *
 * @Author: 夏国倩
 * @Date: 2023/9/16 16:39
 * @Copyright
 */
package QuickHit;

import java.util.Random;
public class GameTest extends Game{
    @Override
    public String printStr() {
        Random ran=new Random();
        String s="";
        for (int i = 0; i < LevelParam.levels[this.player.getLeveiNo()].getStrLength(); i++) {
            int i1 = ran.nextInt(2)+1;
            switch (i1){
                case 1:
                    s+="<";
                    break;
                case 2:
                    s+=">";
                    break;
            }
        }
        System.out.println(s);
        return s;
    }

    @Override
    public void printResult(String s , String s1,int i,int i1) {
        if(s.equals(s1)){
            this.player.setLeveiNo(i);
            this.player.setCurScore(this.player.getCurScore()+LevelParam.levels[this.player.getLeveiNo()].getPerScore());
            System.out.println("输入正确，您的积分为"+(this.player.getCurScore())+",您的级别为"+(this.player.getLeveiNo()+1)+"，已用时间"+i1+"秒");
            if(this.player.getCurScore()==75){
                System.out.println("恭喜成功通关");
                System.exit(1);
            }
        }else {
            System.out.println("输入错误");
            System.exit(1);
        }
    }
}
